package cn.edu.sjtu.dfa;

public class Binop extends Instruction {
	private Register v1;
	private Register v2;
	private Register ret;
	
	private String op;	// TODO maybe def "plus", "minus"... classes
	
	public Binop(Register v1, Register v2, Register ret, String op) {
		this.v1 = v1;
		this.v2 = v2;
		this.ret = ret;
		this.op = op;
	}
	
	public Register getRegister1() {
		return v1;
	}
	
	public Register getRegister2() {
		return v2;
	}
	
	public Register getReturnRegister() {
		return ret;
	}
	
	public String getOP() {
		return op;
	}

	@Override
	public String toString() {
		
		return "Binop: v" + ret.getRegister() + " = " + "v" + v1.getRegister() + " " + op + " v" + v2.getRegister();
	}
}
